" C-Comments
" Last-update:
"    Time-stamp: <2005-02-20 20:26:51>

if exists(&g:comments)
   finish
endif

let g:ccoments=1
command! -rang CComments <line1>,<line2>call CCOMMENTS()
fun! CCOMMENTS() range 
    let fline=a:firstline
    let lline=a:lastline
	if match(getline(fline), "^//") != -1
	    silent execute fline.",".lline."s#^[ \t]*//##g"
	else
		silent execute fline.",".lline."s#^#//&#g"
	endif
endfunction

" command! -nargs=? -rang CUnComments <line1>,<line2>call CUNCOMMENTS()
" fun! CUNCOMMENTS() range 
"     let fline=a:firstline
"     let lline=a:lastline
"     execute fline.",".lline."s#^[ \t]*//##g"
" endfunction

